package com.yuyou.hxyy.service.api.mapper;

import com.yuyou.hxyy.service.api.bean.Pagination;
import com.yuyou.hxyy.service.api.entity.WordUnit;
import com.yuyou.hxyy.service.api.vo.resp.WordUnitStatisticsVo;
import com.yuyou.hxyy.service.api.vo.resp.WordUnitVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface WordUnitMapper {
    int deleteByPrimaryKey(Long userWordUnit);

    int insert(WordUnit record);

    WordUnit selectByPrimaryKey(Long userWordUnit);

    int updateByPrimaryKeySelective(WordUnit record);

    Integer getMaxSort(@Param(value = "repoId") Long repoId);

    void deleteByIds(@Param(value = "ids") String ids);

    void deleteByRepoIds(@Param(value = "repoIds") String repoIds);

    int findWordUnitCount(Pagination<WordUnitVo> queryPgn);

    List<WordUnitVo> findWordUnitPage(Pagination<WordUnitVo> queryPgn);

    List<WordUnitVo> findAllWordUnit(Map<String , Object> condition);

    WordUnit findByNameRepo(@Param(value = "repoId") Long repoId , @Param(value = "name") String name);

    int batchInsertWordUnit(List<WordUnit> wordUnitList);


    List<WordUnitStatisticsVo> getUnitList(@Param(value = "repoId") Long repoId , @Param(value = "userId") Long userId);

    Integer findWordUnitCountByRepo(@Param(value = "wordRepoId")Long wordRepoId);
}